import { FormSchema } from '/@/components/BasicForm/type/form';
import { getAppList, getTenantList } from '/@/api/measurement-center/measurement-sdr/measurementment-sdr';
export const sdrColumns = [
  {
    title: 'ID',
    dataIndex: 'id',
    key: 'id',
  },
  {
    title: '应用名称',
    dataIndex: 'appName',
    key: 'appName',
  },
  {
    title: '租户名称',
    dataIndex: 'tenantName',
    key: 'tenantName',
  },
  {
    title: '实际使用时间(/天)',
    dataIndex: 'actualUsageTime',
    key: 'actualUsageTime',
  },

  {
    title: '套餐生效时间',
    dataIndex: 'effectiveTime',
    key: 'effectiveTime',
  },
  {
    title: '套餐过期时间',
    dataIndex: 'expireTime',
    key: 'expireTime',
  },
  {
    title: '订单状态',
    dataIndex: 'orderStatus',
    key: 'orderStatus',
  },
  {
    title: '套餐类型',
    dataIndex: 'packageType',
    key: 'packageType',
  },
  {
    title: '付费类型',
    dataIndex: 'paymentType',
    key: 'paymentType',
  },
  {
    title: '状态',
    dataIndex: 'status',
    key: 'status',
  },
  {
    title: '操作',
    key: 'action',
    dataIndex: 'action',
    width: 100,
    slots: { customRender: 'action' },
  },
];

export const viewDetailSchema: FormSchema[] = [
  {
    field: 'tenantName',
    label: '租户名称',
    component: 'Input',
  },
  {
    field: 'appName',
    label: '应用名称',
    component: 'Input',
  },
  {
    field: 'actualUsageTime',
    label: '实际使用时间(/天)',
    component: 'Input',
  },
  {
    field: 'effectiveTime',
    label: '套餐生效时间',
    component: 'Input',
  },
  {
    field: 'expireTime',
    label: '套餐过期时间',
    component: 'Input',
  },
  {
    field: 'orderStatus',
    label: '订单状态',
    component: 'Input',
  },
  {
    field: 'packageType',
    label: '套餐类型',
    component: 'Input',
  },
  {
    field: 'paymentType',
    label: '付费类型',
    component: 'Input',
  },
  {
    field: 'status',
    label: '状态',
    component: 'Input',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'tenantCode',
    label: '租户',
    component: 'ApiSelect',
    colProps: {
      span: 6,
    },
    componentProps: {
      placeholder: '请选择租户',
      api: getTenantList,
      resultField: 'list',
      labelField: 'tenantName',
      valueField: 'tenantCode',
    },
  },
  {
    field: 'appId',
    label: '应用',
    component: 'ApiSelect',
    colProps: {
      span: 6,
    },
    componentProps: {
      placeholder: '请选择应用',
      api: getAppList,
      resultField: 'list',
      labelField: 'appName',
      valueField: 'appId',
    },
  },
  {
    field: 'orderStatus',
    label: '订单状态',
    component: 'Select',
    colProps: {
      span: 6,
    },
    componentProps: {
      placeholder: '请选择应用',
      options: [
        {
          label: '有效',
          value: 'active',
        },
        {
          label: '无效',
          value: 'invalid',
        },
      ],
    },
  },
];

export type Page = {
  current: number;
  pageSizeOptions: string[];
  total: number;
  pageSize: number;
};
